﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EF.DAL;
using EF.Model;

namespace EF.BLL
{
    public class BlogCategoryService
    {
        IRepository<BlogCategory> repositoryCategory;
        IRepository<BlogArticle> repositoryArticle;
        public BlogCategoryService(IRepository<BlogCategory> repositoryCategory,IRepository<BlogArticle> repositoryArticle)
        {
            this.repositoryCategory = repositoryCategory;
            this.repositoryArticle = repositoryArticle;
        }

        public BlogCategoryService()
        {
            this.repositoryCategory = new BlogCategoryRepository();
            this.repositoryArticle = new BlogArticleRepository();
        }

        public BlogCategory CreateBlogCategory()
        {
            return repositoryCategory.Create();
        }

        public BlogArticle CreateBlogArticle()
        {
            return repositoryArticle.Create();
        }

        public BlogCategory Insert(BlogCategory entity)
        {
            return repositoryCategory.Insert(entity);
        }

        public BlogCategory Update(BlogCategory entity)
        {
            return repositoryCategory.Update(entity);
        }

        public void Delete(BlogCategory entity)
        {
            repositoryCategory.Delete(entity);
        }
    }
}
